﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MyWeb.Business;
using MyWeb.Data;
using MyWeb.Common;

namespace MyWeb
{
    public partial class Register : System.Web.UI.Page
    {
      
        protected void Page_Load(object sender, EventArgs e)
        {
            
             
        }

        protected void btnRegister_Click(object sender, EventArgs e)
        {
            Boolean checkregis = true;

            Data.tblUserInfo obj = new Data.tblUserInfo();
            if (txtUser.Text == "")
            {
                lblError.Text = "Enter filled full the information!!!";
                lblError.Visible = true;
                checkregis= false;
            }
            if (txtAccount.Text == "")
            {
                lblError.Text = "Enter filled full the information!!!";
                lblError.Visible = true;
                checkregis = false;
            }
            if (txtPassWord.Text == "")
            {
                lblError.Text = "Enter filled full the information!!!";
                lblError.Visible = true;
                checkregis = false;
            }
            if (txtRePassWord.Text == "")
            {
                lblError.Text = "Enter filled full the information!!!";
                lblError.Visible = true;
                checkregis = false;
            }
            if (txtPassWord.Text != txtRePassWord.Text)
            {
                lblError.Text = "Enter filled full the information!!!";
                lblError.Visible = true;
                checkregis = false;
            }
            if (checkregis == true)
            {


                obj._uname = txtUser.Text;
                obj._uaccount = txtAccount.Text;
                obj._upassword = txtPassWord.Text;
                obj._ustatus = "1";
                obj._ucreatedate = DateTime.Now.Month + "/" + DateTime.Now.Day + "/" + DateTime.Now.Year + " " + DateTime.Now.Hour + ":" + DateTime.Now.Minute + ":" + DateTime.Now.Second + "." + DateTime.Now.Millisecond;


                tblUserService.tblUser_Insert(obj);
                lblError.Text = "Register Success!!!";
                lblError.Visible = true;
               

            }
        }

       
    }
}